home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2003 #8 / K-CD-8-2003.ISO / Virtual Skipper / vskipper2_en.exe / {app} / Resource / Media / Text / Vsh / Sprites.vsh.txt < prev    next >
Encoding:
Text File  |  2003-02-07  |  975 b   |  23 lines

  1. vs.1.0
  2. // Decl(Position,    v0)
  3. // Decl(PointSize,    v4)        (Sprite radius)
  4. // Decl(Diffuse,    v5)
  5. // Load(VisualPrCamera,            c0, c3)
  6. // Load(SpriteScaleVect,        c4, c4)    = [tan(FovY/2)/ViewportHeight]*VisualToCamera.Column[Z]
  7. // Load(Time,                    c5, c5)
  8.  
  9. ;------------------------------------------------------------------------------
  10. ; Vertex transformation + color
  11. ;------------------------------------------------------------------------------
  12. ; Transform position to projection space
  13. m4x4    oPos,    v0,        c0 
  14. ; just copy the diffuse
  15. mov        oD0,    v5                    
  16.  
  17. ;------------------------------------------------------------------------------
  18. ; PointSize compute
  19. ;------------------------------------------------------------------------------
  20. ; Transform position to camera space => Get only z, & then scale by tan(FovY/2)/ViewportHeight
  21. dp4        r1.x,    v0,        cSpriteScaleVect0
  22. rcp        r1.x,    r1.x                            ; Get the reciproque
  23. mul        oPts.x, r1.x,    vPointSize.x            ; Scale by vertex's point size